import Vue from "vue";

import Cookies from "js-cookie";

import "normalize.css/normalize.css"; // a modern alternative to CSS resets

import Element from "element-ui";
import "./styles/element-variables.scss";

import "@/styles/index.scss"; // global css

import App from "./App";
import store from "./store";
import router from "./router";
import "./icons"; // icon
import "./permission"; // permission control
import "./utils/error-log"; // error log

import * as filters from "./filters"; // global filters

import Briupdrawer from "@/components/Briupdrawer";
import BriupMap from "@/components/BriupMap";
import PhoneChart from "@/components/PhoneChart";

// 自定义组件
Vue.component("Briupdrawer", Briupdrawer);
Vue.component("BriupMap", BriupMap);
Vue.component("PhoneChart", PhoneChart);

import Vant from "vant";
import "vant/lib/index.css";

import "@/styles/university.css";
import animated from "animate.css"; // npm install animate.css --save安装，在引入

Vue.use(animated);

Vue.use(Vant);

Vue.use(Element, {
  size: Cookies.get("size") || "medium" // set element-ui default size
});
// 登录粒子效果
import VueParticles from "vue-particles";
Vue.use(VueParticles);

// 引入moment
import moment from "moment";
// 全局注册
//过滤器方法名字
Vue.filter("fmtDate_global", function(date) {
  return moment(date).format("YYYY-MM-DD HH:mm:ss");
});

// register global utility filters
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]);
});

Vue.config.productionTip = false;

new Vue({
  el: "#app",
  router,
  store,
  render: h => h(App)
});
